import _mm from 'util/mm.js';
const all = {
    // 获取首页经典产品
    getShuffling: function (resolve, reject) {
        _mm.request({
            url: _mm.getServerUrl('/web/index/getShufflingImg'),
            method: 'get',
            success: resolve,
            error: reject
        });
    },
    // 首页获取经典产品图片
    getClassical: function (resolve, reject) {
        _mm.request({
            url: _mm.getServerUrl('/web/product/getClassicalProduct'),
            method: 'get',
            success: resolve,
            error: reject
        });
    },
    // 首页获取所有大系列及系列下经典产品
    getIndexAllType: function (resolve, reject) {
        _mm.request({
            url: _mm.getServerUrl('/web/TypeAndSeries/getAllTypeAndSeriesAndImage'),
            method: 'get',
            success: resolve,
            error: reject
        });
    },
    // 获取所有大系列
    getAllType: function (resolve, reject) {
        _mm.request({
            url: _mm.getServerUrl('/web/TypeAndSeries/getAllType'),
            method: 'get',
            success: resolve,
            error: reject
        });
    },
    // 获取大类下对应的小类
    getMainProduct: function (data, resolve, reject) {
        _mm.request({
            url: _mm.getServerUrl('/web/TypeAndSeries/getSeriesByType'),
            data: data,
            method: 'get',
            success: resolve,
            error: reject
        });
    },
    // 获取小类中的对应产品
    getAllProduct: function (data, resolve, reject) {
        _mm.request({
            url: _mm.getServerUrl('/web/product/getProductListBySeriesId'),
            data: data,
            method: 'get',
            success: resolve,
            error: reject
        });
    },
    // 发送留言消息
    sendFeedback: function (data, resolve, reject) {
        _mm.request({
            url: _mm.getServerUrl('/web/order/feedBack'),
            data: data,
            method: 'post',
            success: resolve,
            error: reject,
            contentType: 'application/json;charset=utf-8',
        });
    },
    // 发送购物车信息
    sendCartList: function (data, resolve, reject) {
        _mm.request({
            url: _mm.getServerUrl('/web/order/placeTheOrder'),
            data: data,
            method: 'post',
            success: resolve,
            error: reject,
            contentType: 'application/json;charset=utf-8',
        });
    },
    // 获取展示产品的主要信息
    getDisplayInfo: function (id, resolve, reject) {
        _mm.request({
            url: _mm.getServerUrl('/web/product/getProductInfo/' + id),
            method: 'get',
            success: resolve,
            error: reject
        });
    },
    // 关于我们
    getAboutUs: function (resolve, reject) {
        _mm.request({
            url: _mm.getServerUrl('/web/company/info'),
            method: 'get',
            success: resolve,
            error: reject
        });
    },
    // 联系我们
    getContactUs: function (resolve, reject) {
        _mm.request({
            url: _mm.getServerUrl('/web/company/Contact'),
            method: 'get',
            success: resolve,
            error: reject
        });
    }
};

module.exports = all;